//
//  WLTVViewController.m
//  KnowEveryThings
//
//  Created by lanou3g on 16/5/4.
//  Copyright © 2016年 王玲. All rights reserved.
//

#import "WLTVViewController.h"
#import "SearchBar.h"
@interface WLTVViewController ()<UITableViewDataSource,UITableViewDelegate>
///存放cell内容的数组
@property(nonatomic,strong)NSMutableArray *dataArr;
@end

@implementation WLTVViewController

//懒加载
- (NSMutableArray *)dataArr{
    if (!_dataArr) {
        _dataArr = [[NSMutableArray alloc] init];
    }
    return _dataArr;
}


- (void)viewDidLoad {
    [super viewDidLoad];
   
     [self setUpSearchBar];
    
}

 //设置搜索框和navigationItem
- (void)setUpSearchBar{
    self.view.backgroundColor = [UIColor orangeColor];
    self.title = @"视频";
    SearchBar *textField = [[SearchBar alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 35)];
    textField.placeholder = @"请输入关键词";
    self.navigationItem.titleView = textField;
}


#pragma mark - UITableViewDataSource

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return self.dataArr.count;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
    if (!cell) {
        cell = [[UITableViewCell alloc] init];
    }
    return cell;
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}



@end
